//C14:14.6:funds2.c -- struct pointer as argumnt
#include <stdio.h>
#define FUNDLEN  50

struct funds
{
	char bank[FUNDLEN];
	double bankfund;
	char save[FUNDLEN];
	double savefund;
};

double sum(const struct funds *);

int main(void)
{
	struct funds stan = 
	{
		"Garlic-Meon Bank",
		3024.72,
		"Lucky's Savings and Loan",
		9237.11
	};

	printf("Stan has a total of $%.2f.\n", sum(&stan));
}

double sum(const struct funds *money)
{
	return money->bankfund + money->savefund;
}
